#include<stdio.h>

int get_gcd(int num1, int  num2);
int get_lcm(int num1, int num2);
int main(int argc, char *argv[])
{
	int num1;
	int num2;

	int gcd;
	int lcm;
	
	printf("请输入两个正整数：");
	scanf("%d%d", &num1, &num2);
	gcd = get_gcd(num1, num2);
	printf("\n%d和%d的最大公因数为：%d\n", num1, num2, gcd);
	lcm = get_lcm(num1,num2);
	printf("%d和%d的最小公倍数为：%d\n", num1, num2, lcm);

	return 0;
}

int get_gcd(int num1, int num2){
	if(0 == num2){
		return num1;
	}else{
		return get_gcd(num2, num1%num2);
	}
}

int get_lcm(int num1, int num2){
	int res;
	res = (num1*num2)/get_gcd(num1, num2);	
	
	return res;
}

